package nz.ac.massey.softwarec.group3.actions;
import javax.servlet.http.HttpSession;
import nz.ac.massey.softwarec.group3.game.Game;
import nz.ac.massey.softwarec.group3.game.Player;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author wanting
*/
public class ActionTest {
Player player;
Game game;
Action instance;
HttpSession session;
public ActionTest() {
}
@Before
public void setUp() {
player=new Player(5,5,5,false);
game=new Game("username",001);
instance=new Action(player,"action","value",game,session);
}
@After
public void tearDown() {
player=null;
game=null;
session=null;
instance=null;
}
/**
* Test of getPlayer method, of class Action.
*/
@Test
public void testGetPlayer() {
System.out.println("getPlayer");
Player result = instance.getPlayer();
assertEquals(player, result);
}
/**
* Test of getActionType method, of class Action.
*/
@Test
public void testGetAction() {
System.out.println("getAction");
String expResult = "action";
String result = instance.getActionType();
assertEquals(expResult, result);
}
/**
* Test of getValue method, of class Action.
*/
@Test
public void testGetValue() {
System.out.println("getValue");
String expResult = "value";
String result = instance.getValue();
assertEquals(expResult, result);
}
/**
* Test of getGame method, of class Action.
*/
@Test
public void testGetGame() {
System.out.println("getGame");
Game result = instance.getGame();
assertEquals(game, result);
}
/**
* Test of getSession method, of class Action.
*/
@Test
public void testGetSession() {
System.out.println("getSession");
HttpSession result = instance.getSession();
assertEquals(session, result);
}
}